tone_synth object
This method generates a given frequency or list of frequencies that will last for a specified number of milliseconds.
bool freq_ms(string frequencies, double length)
Parameters:
frequencies
A string specifying a frequency or list of frequencies to generate.
length
The length of the generated frequencies, in milliseconds.
Return value:
true on success, false on failure.
Remarks:
Each frequency in the list is separated by a comma and space. Valid values are from 1 to 20000Hz. If the list does not meet the criteria the function will fail.
The frequencies provided in the list will be generated together (as opposed to separately, one after the other), allowing for easier and quicker creation of chords.
Example:
// Write a C major chord using frequencies.
tone_synth synth;
void main()
{
synth.freq_ms("262, 328, 394", 2000);
synth.write_wave_file("wave.wav");
}